<template>
    <div>
        <TitleCard v-if="data.length">{{ title }}</TitleCard>
        <div class="table" v-if="data.length">
            <el-table :data="data" tooltip-effect="dark">
                <template v-for="(item, index) in columns">
                    <el-table-column v-bind="item" :key="index" />
                </template>
            </el-table>
        </div>
    </div>
</template>
<script setup>
import TitleCard from "./titleCard";
defineProps({
    title: {
        type: String,
        default: '',
    },
    data: {
        type: Array,
        default() {
            return []
        }
    },
    columns: {
        type: Array,
        default() {
            return []
        }
    }
})
</script>
<style scoped lang="less">
.table {
}
</style>